import axios from "axios"
import {get} from '@/utils/storage'

const instance = axios.create({
  baseURL: '/dev-api'
})

instance.interceptors.request.use(function (config) {
  // Do something before request is sent
  const token = get('user_token')
  console.log(`token: ${token}`);
  config.headers.Authorization = `Bearer ${token}`
  return config;
}, function (error) {
  // Do something with request error
  return Promise.reject(error);
});

export default instance